package com.zsrt.java.day20161226.zzm.demo03;

import java.util.Scanner;

import org.junit.Test;

public class SwitchDemo03 {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			System.out.println("请您输入一个数:");
			int index = sc.nextInt();
		    System.out.println(phone(index));
		    System.out.println("继续请按c,退出请按y");
		    String temp = sc.next();
		    if(temp.equals("y")){
		    	System.out.println("程序应退出......");
		    	break;
		    }
		}
		
		sc.close();
	}
	public static String phone(int index){
		
		String temp = "";
		switch (index) {
		case 1 : temp = "您拨打的是张三爸爸的电话......"; break;
		case 2 : temp = "您拨打的是张三妈妈的电话......"; break;
		case 3 : temp = "您拨打的是张三爷爷的电话......"; break;
		case 4 : temp = "您拨打的是张三奶奶的电话......"; break;
		default: temp = "你到底拨打的是谁的电话号码呀..."; break;
		}
		return temp;
	}
}
